<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
  <meta name="description" content="gCAD3D-Format-Spezifikation">
  <meta name="keywords" content="3D CAD-Format Spezifikation">
<STYLE TYPE="text/css">
  H1 { color: #000000; font-family:"Helvetica"; font-size:32pt; font-weight:medium }
  H2 { color: #000000; font-family:"Helvetica"; font-size:24pt; font-weight:medium }
  H3 { color: #000000; font-family:"Helvetica"; font-size:20pt; font-weight:medium }
  H4 { color: #000000; font-family:"Helvetica"; font-size:16pt; font-weight:medium }
  hr { border:none; width:100%; height:8; background:#ffcc99;}
</STYLE>
</HEAD>
<BODY LANG="en-US"
      style="font-family:Helvetica; font-size:10pt; font-weight:ormal;">
<PRE>



<a href="gCAD3D_basics_en.htm#Codes">gCAD3D</a>





<HR><!-- ============================================================ -->
<h3>gCAD3D Codes and Formats</h3>
<p><a name="Codes"></a></p>

<A HREF='#fmt1'>General code format</A>

<A HREF='#V'>Variable</A>
<A HREF='#P'>Points</A>
<A HREF='#L'>Lines</A>
<A HREF='#D'>Vectors</A>
<A HREF='#C'>Circles</A>
<A HREF='#S'>Curves</A>
<A HREF='CAD_PLN_en.htm'>Plane / Reference system</A>
<A HREF='format_gcad_A_en.htm'>Surfaces</A>
<A HREF='#B'>Solids</A>
<A HREF='#N'>Notes / Dimensions</A>
<A HREF='#M'>Models</A>
<A HREF='#T'>Transformations</A>
<A HREF='CAD_Activ_en.htm'>Interactions</A>
<A HREF='CAD_Joint_en.htm'>Joints</A>
<A HREF='#U'>Group</A>

<A HREF='#fmt_values'>values</A>             19 RAD_360 V20 X(10) SQRT(L20) ..
<A HREF='#fmt_subObj'>ObjRefs</A>            P(L20 0.5) ..
<A HREF='#fmt_propts'>properties</A>         # properties filtercodes objName ..


<A HREF='Appli_en.htm#Program_codes'>Program_codes</A>

<A HREF='#fmt_attri'>Attributes</A>          Linetype, default-color, ..
<A HREF='#fmt_setti'>Settings</A>            Toolbars, Browser .. ON/OFF   

<A HREF='file_format_en.htm'>gcad file format</A>        



<HR><!-- ============================================================ -->
<p><a name="fmt1"></a></p>
<h4>General format</h4>

The native (internal) format is .gcad.
  Its objectcodes are stored as asciitext, not binary.
  You can also create / modify modelfiles (.gcad) with any editor.

Processing is done sequential by a interpreter.

All objects in memory are kept in analytical form with all definition parameters
  (Ascii text, analytical form)

Curves and surfaces (ellipses, Ruled and Revolved Surfaces) are
  not converted into Splines/NURBS, they are stored / exported
  in their orignal form.

The file format .gcad is the same as the internal format.


There are 3 types of codes: 

  <b>Definition-codes:</b> Generates geometric objects.
    Format is: "{DB-obj} = {parameters ..} [# {properties}"


    DB-obj:
      is stored in DB,
      consists of a type-letter and a DB-index (the obj-ID or DB-ID)
      example: "P123" is a point with DB-index 123
      DB-index 0 is reserved for the active object;
      DB-indexes 1 to 19 should be kept free for script-functions.


    parameters:
      functionCodes   (eg INT (intersect) CUT (trim) ..)
      DB-objs         (eg L20 (db-line 20)
      dynamic-objs    (eg P(10 5 0) ..; see <A HREF='#fmt_dynamic-obj'>dynamic-obj</A>)
      values          (eg 10 (direct) or V20 (DB-variable 20) or VAL(expression) ..)
                      see <A HREF='#fmt_values'>values</A>
      propertyCodes   (eg REV (revers) ..)


    properties (optional, separated by '#', see <A HREF='#fmt_propts'>properties</A>)




    Definition-codes for points eg:           (see <A HREF='#P'>Points</A>)
      P123=P(10 5 0)              # point-123 = point at x=10, y=5, z=0
    - with parameters:
      P124=INT S30 L24            # intersection curve-30 with line-24
      P126=PRJ P37 L21            # projection of P37 onto line-21

    Definition-codes for lines eg:            (see <A HREF='#L'>Lines</A>)
      L20=L(P20 P(10 5 0))        # line from point 20 to coords (10 5 0)
    - with parameters:
      L20=TNG P30 C20             # line-20 is a tangent from point-30 to circle-20




    Create definition-codes:
      - with module CAD - see <a href="CAD_using_en.htm">using CAD</a>
      - or with module MAN - see <a href="MAN_en.htm">using MAN</a>
      - or produce the codes direct (with editor or scripts or plugins ..)


  <b>Execution-codes:</b>
     - set / change attibutes (Linetype, color, construction-plane ..)
     - consist of a direct statement,
     eg DEFCOL 0 0 220     # set default colour blue
     see <A HREF='#fmt_attri'>Attributes</A>
     and <A HREF='#fmt_setti'>Settings</A>


  <b>Programming-codes:</b>
    - control the programflow (IF JUMP CALL EXIT DEBUG PRI ..)
    eg PRI "P20=" P20"     # print coords. of point P20
    see <a href="Appli_en.htm">- Programmingcodes</a>


<HR><!-- ============================================================ -->
<p><a name="Codeletters"></a></p>

All objects stored in DB need one of the following codeletters:


<B>Codeletters:</B> 
A = Area (surface) 
B = Body (Solid) 
C = Circle (circle), 
D = Direction (vector) 
I = Interaction
J = Joint
L = Line 
M = Model, Sub-model, mockup model, standard part of 
N = Note, Tag, bitmap image 
P = Point (points)
R = Refsys (referencesystem, plane)
S = Spline (B-spline-curve, polygon, trimmed-curve, ..)
T = Transformation (Translation, rotation, .. ) 
U = Union (Group) 
V = Variable (value number.) 


<B>DB-index:</B> 

  0 (zero) can not be used (is the current object) 
  Is a positive number for permanent objects, 
  Is a negative number for temporary objects that are dynamically generated.





<HR><!-- ============================================================ -->
<p><a name="V"></a></p>
<h3>Variable</h3>
Identification key for a variable is V. 
<HR><!-- ============================================================ -->

see also <A HREF="CAD_Var_en.htm">CAD functions variable</A> 

- stores a numeric value in DB;  "V{DB-index}={numeric_expression}"

  Example:
    V20=25              # DB-variable 20 = 25
    C20=P20 V20         # circle aroud P25 with radius = 25
    V21=V20 * 2
    V22=2 * X(P20)     # V22 is X-coord. of P20 * 2


Numeric expressions see <A HREF='#fmt_values'>values</A>




<HR><!-- ============================================================ -->
<p><a name="P"></a></p>
<h3>Point</h3>
Identification letter code of a point is P.
<HR><!-- ============================================================ -->

see also <A HREF="CAD_PT_en.htm">CAD-point functions,</A> 
see also <A HREF="#fmt_subObj">ObjRefs</A>


# 3D point absolute 
P21 = P(10 20 0) 


# points from polar coordinates (rotate around the active Z-axis)
# P = BasePoint, RotationAngle, [Tilt Angle,] Distance
P5 = P4 ANG(90) 25           #  25 units from P4 along X-axis rotated 90 deg around origin/Z-axis
P6 = P4 ANG(90) ANG(45) 50   # rotate P4 90 degrees and tilt up 45 degrees, length 50.


# create point with offset
# P = BasePoint, [X-offset,] [X-offset,] [Z-offset]
P21 = P20 X(10) Y(5)         # move point P20 10 units along x-axis, 5 units along y-axis


# move point; 
# P = BasePoint, Direction, [Distance,] [NormalDistance]
P21 = P20 D20 10             # move P21 into direction of vector D20 distance 10
P22 = P21 D(P20 P21) 10      # - vector from P20-P21
P23 = P20 D(L20) 10          # - vector from line



# get characteristic points of objs; eg startpoint, endpoint, midpoint ..
See <A HREF="CAD_PT_en.htm#F5">characteristic-point-functions</A>
P20=C20             # center of circle: or
P20=C20 PTS(1)      
P24=L21 PTS(2)      # endpoint of line, or:
P24=P(L21 PTS(2))
P7=S20 PTS(2)       # endpoint of curve S20
P3=P1 P2            # midpoint
P3=L1 PTS(3)        # midpoint


# point from joint-import (joint 1 from submoodel M20)
P20=IMP M20 J1



# Rotate a Point around the Z-axis of the active construction plane
# P = BasePoint, RotationAngle, [Tilt Angle,] [Distance]
#   optional: rotate (tilt) normal to the Z-axis 
#   optional: distance from BasePoint to new point 
P3 = P1 P2 ANG(180)       # rotate P2 180 degrees around P1/Z-axis
P4 = P1 P2 ANG(90) ANG(45)       # rotate P2 180 degrees around P1/Z-axis
P5 = P1 P2 ANG(45) DX            # rotate P2 45 degrees around P1/DX
P6 = P1 L2 ANG(30)               # rotate P1 30 degrees around line L2


# Rotate a Point around a axis:
# P = point, rot-axis, angle
P21=P20 L20 ANG(30)    # rotate P20 30 degrees around line L20



# project point onto obj (line, circle, spline ..)
# P = [PRJ] point, curve [solution-nr]
P2 = P1 L1        # project P1 onto line L1
# or
P2 = PRJ P1 L1
P11=P1 S10 MOD(2)     # 2. solution-point of projetion onto curve S10
P22=P20 R20           # projection onto plane R20




# point from intersection obj - obj (line, circle, spline ..)
# P = INT curve, curve, [solutionNr]
P4=INT L1 L2          # point from intersection line L1 - Line L2
P4=INT C1 C2 MOD(2)   # intersection-point nr. 2 from intersection C1 - C2
P41 = L20 A20         # intersection Line - B-SplineFläche 




# transfer point into other reference-system
# P = TRA  point, plane
P20=TRA P20 R20  # transform point P10 into reference-system from plane R20





<HR><!-- ============================================================ -->
<p><a name="L"></a></p>
<h3>Line</h3>
Identification key for Line is L.
<HR><!-- ============================================================ -->

see also <a href="CAD_LN_de.htm">CAD-Function Linie</a>
see also <A HREF="#fmt_subObj">ObjRefs</A>


P20=10 0 0
L20= P20 P(100 100 0)        # line between 2 points 

L21=Y(10)                    # horizontal line at Y=10


L22=DY P20                   # direction y-axis, starting at P20


# line with given direction:
#   additional parameter can be length, offset-values, CX, UNL/UNL1/UNL2

L23=P20 ANG(45)              # starting at P20, with direction (vector) 

L24=D(ANG(0) ANG(30)) P20    # with rot-angle and tilt-angle
# rotation is around active z-axis, tilt is normal to z-axis.

L25=D(L24) P(50 -100 0)      # parallel L24, new startpoint


L26=L23 L24                  # angle bisector, from intersectionpoint

L27=L23 L24 ANG(90)          # angle bisector, additionally rotated



# line tangential to 2 objects:
#   additional parameter can be MOD, REV, UNL/UNL1/UNL2

# line tangent to 2 circles (Location: in out) 
L31=TNG C20 C21 MOD(2)

# line tangential to circle, parallel to line. 
L30=TNG C20 D(L1) MOD(1)

# line tangent to circle with a fixed angle 
L32=TNG C20 D(ANG(45)) MOD(1)

# tangent line through point P10 to S10 curve. 
L33=TNG P20 S10 MOD(1)

# line through point, tangential to circle 
L34=TNG P1 C1 MOD(1)



# cut line; result is a trimmed-curve (S)
S20=CUT R20 R21 


# projection of a line onto plane. 
L40=PRJ L20 R20 






<HR><!-- ============================================================ -->
<p><a name="D"></a></p>
<h3>Vector / direction</h3>
Identification key for a vector is the letter D ( "Direction"). 
<HR><!-- ============================================================ -->



A vector defines a direction and is not bound to any position. 
representation of vectors:
  - vectors are only temporarily displayed, 
  - Always in the center of the screen. 
  - Normalized vectors (with length 1) in black, otherwise red. 


The following are standard vectors: 
  DX DY DZ           according to standard axis directions; 
  DIX DIY DIZ        correspond to the inverse standard axis directions 


Display of Vectors:
- Vectors are only temporarly represented;
- standard-vectors are displayed in the lower right corner
- scan through defined vectors with the PageUp or PageDown button
- Standardized vectors (with length 1) as dashed line, otherwise as full line.



See also <a href="CAD_Vec_en.htm">CAD-Function Vector</a>
Definition of a vector: see <a href="CAD_input_en.htm#_Vec_">vector</a> 
see also <A HREF="#fmt_dynamic-obj">dynamic vectors</A>




 
<B>Standard formats</B> 

# defined by vector direction and length. 
# D = D(dx, dy [, dz]) [length] [ "REV"] 
D1=DX 100 
D2=D(10 0) 
D3=D(0.7 0 0.7) 100 


# Define vector by rotation-angle, tilt-angle (optional), vector length (optional). 
D3 = ANG(30) 100 
D4 = ANG(90) ANG(30) 100 
# First rotate around Z-axis, then around the new Y-axis.
# ANG(0) ANG(0)      - gives Vector 1,0,0
# ANG(90) ANG(0)     - gives Vector 0,1,0
# ANG(90) ANG(30)    - gives Vector 0,0.9,0.5
# ANG(180) ANG(30)   - gives Vector -0.9,0,0.5


# vector from 2 points, vector length (optional)
D5=P1 P2
D5=P1 P2 100


# vector from line, vector length (optional)
D6=L10 100 


# vector = tangent to curve
D25=C20 PTS(1)   # tangent at startpoint of C20
D24=C20 0.25     # tangent to circle at 25% (eg 90 deg for full circle)




# standard-vectors of Circ, ellipse, Plane through Modifier: 
#  MOD  plane   ellipse       circle
#   0   Z-axis  normal-axis   normal-axis
#   1   X-axis  major-axis    center-startpoint
#   2   Y-axis  minor-axis    center-endpoint

D20 = C20 MOD(2) provides the vecto centerpoint - endpoint of C20


# Normal vectors: 
#   D = Circle
#   D = Ellipse
#   D = Plane
#   D = Point Point Point 
#   D = Line Line 
#   D = Line Point 
#   D = Vector Line 
#   D = Vector Point Point 

D21=C20 100         # vector in the direction of the Z-axis of C20, length 100 
D22=R10 REV         # vector in the opposite direction of the Z-axis of plane R10
D23=L20 L21         # normal-vector to lines L20 L21




<HR><!-- ============================================================ -->
<p><a name="C"></a></p>
<h3>Circle / Arc</h3>
Identification key for circle/arc is C
<HR><!-- ============================================================ -->

see also <A HREF="CAD_CI_en.htm">CAD functions circle / arc (Circle / Arc)</A> 




Definition of a circle by defining an arc by: 

- C (Start Point Endpoint centre [Z-axis] [Rotation direction]) 
- C (endpoint center [Z-axis] [Rotation direction]) 
  Points here with index "P20" or "xCoord yCoord [Z (zCoord]" 
For example: | C (25 0 0 25 0 0) 
If the starting point, then the endpoint is the last P(), L() or C() - the definition used. 
- Selection of a circle, 
  the name, eg "C20" 
- selection of a circle in a Contour (CCV): 
  C (S{ccv} MOD({ccvSegNumber})) 


Deviation:
  The deviation for the presentation of the circles can be set directly in Standards/Tolerances with tolerances for the representation – Polygon."
  Furthermore, by changing the Model size (MODSIZ) the deviation is set. 

Parameter direction of rotation: 
<B>CW</B> (clockwise) or 
<B>CCW</B> (counter-clockwise) 
The specification of CCW is not required (default). 

The turning point is valid if the spin axis of the eye of the beholder shows. 
# Circle copy 
C2 = C1 


<B>Standard formats:</B> 
# concentrically. circles. Negative radius difference shrinks the circle. 
C2 = C1 (radius differential) 
# center point, point at the periphery [Z-axis vector] 
C3 = P1 P2 
C3 = P1 P2 D(1 0 1) 
# center, tangential to Line/Circ 
C1 = P1 L1 
C1 = P1 C1 
# Tangential to 2 elements, radius. 
# C1 = P1, L1, Radius, page 
# C2 = P1, C1, Radius, page 
# C5 = L1, L2, Radius, page 
# C5 = L1, C1, radius, Page 
# C5 = C1, C2, Radius, page 
L1 = X (10) 
L2 = Y (10) 
C1 = L1 L2 VAL(5) MOD(1) 

# 2 points on the scale radius. page on which the center is located. 
# C1 = P1 P2 radius side Z-axis vector 
P20 = P(98.6 5.4 0) 
P21 = P(114.5 -15.2 0) 
C22 = P20 P21 VAL(12) MOD(1) DR 

# point at the periphery, tangent, radius . 
#C1 = P1 L1 radius side 
L20 = P(44.6 -32.8 0) P(86.5 -69.3 0) 
P26 = P(56.2 -35.5 0) 
C21 = P26 L20 VAL(8) MOD(2) 

# point at the periphery, tangential to a circle. 
# C2 = P1 C1 radius page 
C20 = P (114.5 -15.2 0) VAL (12) DR 
P27 = P (96.9 -19.7 0) 
C21 = P27 C20 VAL (8) MOD (1) 

# Circle through three edge points 
C20 = P (0 0) P (10 0) P (10 10) 


<B>Arc (limited circles):</B> 

  Start center point of rotation angle Z-axis vector 
C21 = ARC P20 P21 ANG(90) DZ 

  Circ ARC starting point endpoint center [Z] [Rotation direction] 
  Arc from start point endpoint center (center axis of rotation direction) 
  Rotation direction: CW (clockwise) or CCW (counter-clockwise, default). 
  The turning point is valid if the spin axis of the eye of the beholder shows. 
C20 = ARC P1 P2 P3 
C31 = ARC P(10,0,10) P(0,10,10) P(0,0,10) = 
C32 = ARC P(10,0,0) P(0,0,10) P( 0,0,0) D(0,1,0) CW 
  Circ ARC start point, end point, radius, Z-axis 
  Arc from start point endpoint radius center axis
  Radius: positive for clockwise, negative for counter-clockwise. 
C21 ARC = P(251 23 0) P(189 75 0) VAL(50) DZ
  
  Double arc through the starting point, starting direction, and radius. off direction: the tangent to the circle in the Start point. A vector. 
  Angle: start angle, optional, default is 360 degrees. 
  Axis vector optional. 
  [CW / CCW] is the direction of rotation; optional ( "CW").
Example: End tangents of a Clothoid as the start direction. 
S20 = CLOT P(0 0 0) DX ANG(30) 0 10 
P20 = P(S20 1) 
D20 = TNG P20 S20 
C20 = ARC P20 D20 25 ANG(30) 


  Arc through three points on the edge 
C20 = ARC1 P (0 0) P (10 0) P (10 10) 


<B>Implicit Definition of circles/arcs:</B> 

C ((starting point) (end) (center) [Z] [Direction]) 
C ((end) (center) [Z] [Direction]) 
here only points with index "P20" or "xCoord yCoord [Z (zCoord] "
Example: C(25 0 0 25 0 0)   



<B>Circle from copyfunction</B> 
These formats are generated when selecting features 
Circle from CCV: 
C(S{ccv} MOD({ccvSegNumber}))
 




<HR><!-- ============================================================ -->
<p><a name="S"></a></p>
<h3>Splines/Curves</h3>
Identification letter for curves is S (spline).
<HR><!-- ============================================================ -->

see also <A HREF="CAD_CV_en.htm">CAD functions for curves</A> 



Polygon 
ellipse 
Clothoide 
free-form curve (B-Spline) 
contour (compound curve) 
polynomial curve (currently only import programs or MANual) 

<B>Standard sizes ellipse:</B> 
  ellipse from center, endpoint main axis, endpoint Besides axis: 
S1 = ELL P (100 0) P (150 0) P (100 20) 
ellipse from center, the main vector, vector addition axis: 
S1 = ELL P(100 0) D(10 0) D(0 5)
 (the vectors defining the direction and length of main and secondary axes) 

 Limited ellipse from center, main axis vector, secondary axis vector, starting point and end point: 
S1 ELL = P(0 0) D(10 0) D(0 5) P(10 0) P(-10 0) 

 projection of an ellipse from circle on plane: 
S20 = R20 ELL C20 

<B>Standard formats polygon:</B> 
 Parallelogram from one point and 2 vectors: 
 S = REC pt1 vec1 vec2 
 (vectors: the direction and length!) 
S20 = REC P(100 0 0) D(50 0 0) D(0 12 0)  

 Polygon of points: 
 S# = POL, point1, point2 &lt;POINT3, .. pointn&gt; 
P20=P(10,10) 
P21=P(20,20,15) 
P22=P(25,20) 
S24=POL P20 P21 P22 P(30,12,0) P(30,10,10) P(40,30,10) 

 Polygon projected onto plane
 S#=POL Polygon Refsys 
S20=POL P(30,0) P(30,10,10) P(40,30,20) 
S21=POL S20 R0 

 3D-Polygon from B-Spline: 
 S#=POL,B-Spline,Tolerance 

<B>Standard formats Clothoids:</B> 
 Create a clothoid curve (by a planar spiral through Fresnel integrals). 
 Start Point       Start Point 
 Start Vector      Start direction (or vector angle) 
 Angle             Difference Angle off direction-toward the end point is positive, clockwise (CW); 
                    negative: counterclockwise (CCW). 
 Start radius      Radius at the start point, or 0 for infinite radius 
 EndRadius         Radius at the end point or 0 to infinity 
 [Z-Axis]          Normal vector; optional. 

S20 = CLOT P(0 0 0) ANG( 0) ANG(30) 0 10 

Example Model: see sample_cloth1.gcad 

To export a clothoid curve: 
 DXF: Output as POLYLINE. 
 Iges: output entity 106 (CopiousData, form 12 = 3D polygon). 


<B>Standard formats B-spline:</B> 

 B-spline from control points/node vector: 
 S-bsp=BSP, ptNr, degree, control points, node vector, startup parameters, end parameter 
  ptNr = number of control points, 
  control points: the control points, number = ptNr, 3 values (X/Y/Z). 
  node vector: the distance parameter, number = ptNr + degree + 1  
S20 GNP, 6.3, -178,109,0, -166,128,0, -144,109,0, -109,112,0, -106,134,0, -119.138, 0,0,0 , 0,0,0.333333,0.666667,1,1,1,1,0,1 

 B-Spline from points: 
 S-bsp = BSP{points} [, degree] [, CTRL] 
 CTRL: whether the defined points are transit points or control points. 
P20 = P (78.9) 
P21 = P (66.28) 
P22 = P (44,9,25) 
P23 = P (9.12) 
P24 = P (6.34) 
# B-spline from Points 
S20 + BSP, P20, P21, P22, P23, P24 

 B-spline from polygon: 
 S-bsp = BSP {polygon} [, degree] [, CTRL] 
 CTRL: whether the defined points are transit points or control points. 
P20 = P (78.9) 
P21 = P (66.28) 
P22 = P (44,9,25) 
P23 = P (9.12) 
P24 = P (6.34) 
# B-spline from points 
S20 = GNP, P20 , P21, P22, P23, P24 
# Polygon from Points: 
DRAW OFF 
S21 = POL, P20, P21, P22, P23, P24 
# BSpline from Polygon 
DRAW ON 
S22=BSP, S21

 B-Spline = isoparametric curve from a surface 
 Currently from B-Spline surface only, entry point instead of parameter value has not yet been implemented 
 S-bsp = ISO {B-Spline surface} {parameter value} [{direction}] 
  (Modifier CX = across; Default = along) 
# cross-section curve in the middle of the Surface A20: 
S20 = ISO A20 0.5 CX


<B>Standard format contour (compound curve):</B> 

Contour ("concatenated Curve"-CCV), 
The contour begins and ends at a point. 
Elements: points, lines, circles, curves. 
Following circles and curves, the direction of rotation (CW or CCW) can be defined. 
It will automatically be formed normal to lines and arcs. 

Format: 
S# = CCV {contour elements} 

Example: 
C20 = P(39.26) VAL( 22) 
S20 = CCV P (7.25) C20 CW P (35.58)  


<B>Standard format polynomial curve:</B> 

 Polynomial curve from evaluating a polynomial: 
 S# = PSP3, arc1{, arc2, .. arcn} 
 Polynomial curve with 1-n arcs. 
 An arc comprises 13 numbers, the distance value and the evaluated polynomial 
 xa, ya, za, xb, yb, zb, xc, yc, zc and xd, yd, zd. 
 xa, ya, za defines a passage point. 
S20=PSP3,0,3.84815,0.967105,0,0.577021,0.207039,0,0,0,0,-0.169071,0.140166,0, 1,4.2561,1.31431,0,0.069808,0.627537,0,-0.507212,0.420498,0,0.341924, -0.327596,0,2,4.16062,2.03475,0,0.081155,0.485747,0,0.518559,-0.562288,0, -0.183075,0.224101,0,3,4.57726,2.18231,0,0.56905,0.033474,0,-0.030664, 0.110016,0,-0.060996,-0.13481,0,4,5.05465,2.19099,0,0.324734,-0.150924,0, -0.213651,-0.294414,0,0.071217,0.098138,0,5,5.23695,1.84379,0,0.111083, -0.445338,0,0,0,0,0.427303,0.588828,0 




<HR><!-- ============================================================ -->
<p><a name="B"></a></p>
<h3>Solids (Bodies)</h3>
Identification letter for Solids is B (Body).
<HR><!-- ============================================================ -->

see also <a href="CAD_SOL_en.htm">CAD-Functions for Solids (Bodies)</a>



Cone 
Torus
Sphere
Prism

<HR><!-- ============================================================ -->
<b>Sphere: </b>

# Sphere from the radius center: 
B1 = SPH P(0 0 0) 12 

# Sphere from circle: 
C1 = P(0 0 0) 12 
B2 = SPH C1 







<b>Cone-shaped body: </b>

   B2 = CON Midpoint_1 Midpoint_2 Radius_1 Radius_2 
B20 = CON P(0 0 0) P(100 0 0) VAL(60) VAL(40) 

   B3 = CON circle_1 circle_2
C20 = P(0 0 0) VAL(100) DX 
C21 = P(100 0 0) VAL(40) DX 
B20 = CON C20 C21 

   B1 = CON base_circle point_cone_top





<b>Torus / circular ring: </b>

  B# = TOR centrPt axis Radius_major Radius_minor

  B# = TOR L C    // axis outer_circle 
  B# = TOR C C    // main_circle, outer_circle 
  B# = TOR R C    // mani_radius,  outer_circle 
   
  
  The axis of the circle of skin is the main axis. 
  The minor circle axis is always normal to the main axis. 
  Radius_major circle is entirely on the outside, and is always positive. 
  Modifier_outer_Inner: required for selection of a variant 
   where the Radius_major circle is smaller than the Radius_minor circle. 

B20=TOR P(0 0 0) DZ VAL(100) VAL(25)
C20=P(100 0 0) VAL(25) DY
B20=TOR P(0 0 0) DZ C20




<b>Prism: </b>

  B = PRISM plane_Base_surface Vector/Point/thickness 
  
  plane_Base surface: Closed Polygon/Circle/Ellipse 
  The opposite surface may be a point or defined by a vector 
  or by the thickness (for example wall thickness). 

# Prism from Parallelogram and vector 
S20=REC P(100 0 0) D(50 0 0) D(0 12 0)
B20=PRISM S20 D(0 0 10)

# Prism from circle with thickness (cylinder height) 
C20=P(289 -20.8 0) VAL(125) DZ
B20=PRISM C20 25

# Conic prism from polygon 
20=P(768 -457 0)
S20=POL P20 P(930 -474 0) P(1029 -251 0) P(971 -246 0) P(891 -412 0) P(801 -407 0) P20
B21=PRISM S20  P(900 -500 200)






<HR><!-- ============================================================ -->
<p><a name="N"></a></p>
<h3>Notes / Dimensions</h3>
Identification letter for Notes/Dimensions is N. 
<HR><!-- ============================================================ -->

see also <a href="CAD_TxtG_en.htm">CAD-Functions for Notes / Dimensions</a>



   The font size for text and dimensioning is defined by 
DEFTX {Textsize} {DimTextSiz} {text general scale} {number decimal places} 
   or interactively in Standards/Text. 
   Default values in the file {base}/xa/gCAD3D.rc. 

TODO: 
TEXTS AND DIMENSIONS ARE NOT EXPORTED TO IGS or DXF. 
For interactive modification of the parameters Marrow, Mline
  and additional text a user interface is to be created.








<HR><!-- ============================================================ -->
<p><a name="M"></a></p>
<h3>Model</h3>
Identification letter for Models is M.
<HR><!-- ============================================================ -->

see also <a href="CAD_Model_en.htm">CAD-Functions for Models</a>


A model (a Assembly) can consist of several Models (Sub-models)</P>




<HR><!-- ============================================================ -->
<p><a name="T"></a></p>
<h3>Transformations</h3>
Identification letter for Transformations is T.
<HR><!-- ============================================================ -->

see also <a href="CAD_Tra_en.htm">CAD-Functions for Definition of Transformations</a>
see also <a href="CAD_Modify_de.htm#F2">CAD-functions for modifying geometry</a>





<HR><!-- ============================================================ -->
<p><a name="CWCCW"></a></p>
<B>Rotation </B>
 CW      (clockwise) or 
 CCW     (counter-clockwise) 
 The specification of CCW is not required (default). 
 The rotation results in plan view of the axis of rotation 
 as seen by the eye of the beholder. 


<p><a name="ANGR"></a></p>
<B>Rotation angle (Rotate) </B>
 The rotation is around the Z-axis of the active construction plane. 
 Input directly: Angle 
 Enter indirectly: ANG(angle) 
 Output format: ANG(angle ()), for example: 
 ANG(30) - rotation by 30 degrees 
 # Angle value 
 ANG (angle value [REV]) 
 # Direction vector 
 ANG (D [ANG () / REV]) 
 # Line (direction) 
 ANG (L [ANG () / REV]) 
 # 2 Points (direction) 
 ANG (P P [ANG () / REV]) 
In CAD mode, the PgUp / PgDown button can add together one additional (relative) 
 angle value of about +90 degrees. (There must have been a prior 
 selection to indicate direction (eg select a line)). 



<p><a name="ANGT"></a></p>
<B>Tilt angle</B>
The rotation (tilting) is done to the new Y-axis created by a rotation of the Z-axis. 
 A tilt angle of 90 degrees provides the Z-axis (independent from the angle of rotation). 
 
Output format: ANG({angle}), for example: 
 ANG(30) - rotation by 30 degrees 
Example of rotate and tilt: 
 ANG(90) ANG(30) 
 There the object is rotated 90 degrees around the Z axis; 
 The horizontal axis now corresponds to the old X-axis, tilt axis at this 
 tilt is now around 30 degrees. 
 A negative tilt angle rotates in the opposite direction. 


<p><a name="MOD1"></a></p>
<B>Page 1 / 2</B> 
 Page: with PageUp / Down button; 
 1, 2 lateral right / left; 
 Output Format: MOD (1) or MOD (2) 


<p><a name="iCol"></a></p>
<B>Color </B>
 0 = black 
 1 = DefCol 
 2 = red 
 3 = green 
 4 = blue 
 5 = yellow 
 6 = magenta 
 7 = cyan 
 8 = white 
 9 = hilite
 10 = dimmed
 
 
<p><a name="SymbolType"></a></p>
   <b>SymbolType</b>
     0 = star small,
     1 = small triangle
     2 = small circle
     3 = large rectangle
     4 = normalized vector (always same length, arrowhead points to EndpointVector)
     5 = vector (with correct length, arrowhead is at EndpointVector)
     6 = Arrowhead 2D (SymbolPosition is the arrowhead)



<HR><!-- ============================================================ -->
<p><a name="symFnam"><h4>Symbolic modelfilenames</h4></a></p>

A symbolic-directory is a abbreviation for a directory-path.

A symbolic file name consists of 
"{symbolic-path}/{filename}" 

The assignements symbolic-path to full-directory-path are defined in files.

All symbolic path-names are defined in the active directory-path-file.

The active directory-path-file can be changed with <a href="Settings_en.htm#ModelDirectoryFile">select directory-path-group</a>).


The default directory-path is ~/gCAD3D/dat; its symbolic name is "Data".

Examples symbolic filenames:
"Data/Niet1.dat"
"Data/symEl1/res1.gcad"

To edit the files see <a href="Settings_en.htm#ModelDirectories">edit directory-path-group</a>.




<HR><!-- ============================================================ -->
<p><a name="U"></a></p>
<B>Group </B>
Identification key for group is U. 
<HR><!-- ============================================================ -->
Select the objects in the group - the objects will be highlighted. 
Remove from the group by selecting again. 
Go to the next field with the Tab key. 
Example: 
# Group 2 surfaces 
U (A20 A21) 




<HR><!-- ============================================================ -->
In the CAD input fields numerical values can be used (eg, for radius only) as well as variables, 
PI, the basic arithmetic and mathematics. Functions are also used (but not the functions X, Y, Z and L, C).





<HR><!-- ============================================================ -->
<p><a name="fmt_attri"></a></p>
<h3>Format Attributes:</h3>


<B>Set Hide / View</B>
# Hide object B20
SHOW B20 OFF
# redisplay
SHOW B20


<B>Create new linetype </B>
ATTL <indexNr> <colour> <lineTyp> <lineThick>
Example:
ATTL 20 9 2 4

# create lineAttribute 20 with color 009 = blue, 2=dashed, 4=linewidth

 Format: indexNr colour lineTyp lineThick // comment

   colour     3 digits; red, green, blue.
              900 = red,   090 = green, 009 = blue;
              000 = black; 999 = white, 990 = yellow ..
   lineTyp:   0 = full-line (VollLinie);    1 = dash-dot (Strich-Punkt),
              2 = dashed (kurz strichliert) 3 = dashed-long (lang strichliert),
   lineThick: 1-6, thickness in pixels

Max. nr of attribute-records is 44 (indexes 0 - 44)
Defaults are in file <cadbase>/gCAD3D/<config>/ltyp.rc
  config is eg cfg_Linux.



<B>Set Linetypes</B>

# apply linentype 8 to objects L21 und L22
ATTL 8 L21 L22
# Siehe <a href="Settings_en.htm#Linetypes">Defaultsettings</a>


<B>Set surface attributes (color, shading, transparency ..)</B>

# set surface A21 symbolic (not shaded)
ATTS "S" A21

# set transparent  (T0=reset, T1=half transparent, T2=full transparent)
ATTS "T2" A21

# set color green (red-share-0, green-share-255, blue-share-0)
ATTS "C00ff00" A21

# reset previous color (default-colour)
ATTS "C" A21


See also: <a href="Attribs_en.htm">Set Attributes</a>



<HR><!-- ============================================================ -->
<p><a name="fmt_setti"></a></p>
<h3>Settings:</h3>

# menu off
MODE MEN OFF

# browser off
MODE BRW OFF

# upper toolbar off
MODE BAR1 OFF

# messagewindow off
MODE BAR2 OFF

# restore messagewindow
MODE BAR2 ON

# Display planes off
MODE DISP_PL OFF

# Display points on (in mode VWR display points is OFF per default)
# interactive: Display/PointDisplay ON
# - add at end of model - works for already existing objects
MODE DISP_PT ON

# Display points off
MODE DISP_PT OFF

# Display all object-names  (interactive: Display/ObjNames ON)
# - add at end of model - works for already existing objects
MODE DISP_OID ON

# do not display object-ID's of Notes (if "MODE DISP_OID ON" is active)
# - add before defining Notes
MODE DISP_ONAM_NT OFF



<HR><!-- ============================================================ -->
<p><a name="fmt_values"></a></p>
<h3>Values:</h3>


<b>Direct: enter number with keybord;</b>
V20=10
V21=V20 + 10



<b>Basic mathematic operations:</b>
  + - / * ^   (plus minus multiply subtract power)

Process * before +- not supported - 
  - must be specified with brackets
V35=10 + 5 * 2     # 30
V36=10 + (5 * 2)   # 20

  Power:
V27=4^0.5       # result is 2 (4 to the power 0.5)


<b>Numeric Constants:</b>
PI         PI               3.1415926535897932384
RAD_360    PI * 2           6.2831853071795862319
RAD_180    PI               3.1415926535897932384
RAD_90     PI / 2           1.5707963267948965579
RAD_1      PI / 180         0.0174532925199432954
SR_3       SQRT(3)          1.732050808
SR_2       SQRT(2)          1.414213562

V22=V21 * PI



<b>Geometric Constants:</b>
   DX DY DZ DIX DIY DIZ           Standardvektoren
   RX RY RZ RIX RIY RIZ           Standardebenen



<b>Geometric funktions:</b>
    X(P20)                   x-coordinate of point 20
    Y(P20)                   y-coordinate of point 20
    Z(P20)                   z-coordinate of point 20
    VAL(C20)                 radius of circle 20
    VAL(L20)                 length of line 20
    VAL(P1 P2)               length between 2 points
    VAL(P1 L1)               normal distance from point to line
    ANG(..)                  angle

  Example:
    C21=P21 VAL(C20)     # circle with same radius as C20
    V29=ANG(D(L(P(0 0 0) P(10 10 0))))  # 45 - angle of vector from 2 points


<b>Mathematic functions:</b>
   SIN () COS () TAN () ASIN () ACOS () ATAN ())
   SQRT()      square-root
   ABS()       Absolute value (the sign is always positive)
   FIX()       remove the numbers after the decimal point
   RND()       Rounding. 1.3 to 1.0, 1.8 to 2.0, -1.3 to -1.0, -1.8 to -2.0


  V24=ABS(-12.5)    # 12.5
  V25=FIX(1.8)      # 1.0



<b>Display content of variable:</b>
PRI "V26 = " V26
PRI "P20 = " P20



<HR><!-- ============================================================ -->
<p><a name="fmt_propts"></a></p>
<h3>Properties:</h3>

  - Properties follow the definitioncode separated by '#'
  - Properties can be used for filtering objects  (see <a href="Search_de.htm">Search / Name</a>)


  Example:
    P20=0,0,0            # Origin BaseLayer
    V30=V20+(V21*1.2)    # sum 
    


<HR><!-- ============================================================ -->
<p><a name="fmt_dynamic-obj"></a></p>
<h3>Dynamic-objs:</h3>

   -  obj is stored in the dynamic-area, 
   -  is not yet stored in DB or is a sub-object of an DB-obj;
   -  consists of a type-letter and parameters


  Example new defined dynamic-obj:
    P(10 5 0)              # point at x=10, y=5, z=0;
    L(P20 P(10 5 0))       # line from point 20 to coords (10 5 0)
    D(V20 0 0)             # vector - cartesian; x-coord from variable
    C(P(0 0 0) P(10 0 0))  # circle from centerpoint, point on circle


  Example sub-object:      eg P(L20 PTS(1)) # startpoint of line L20
    - is a reference to a component of an existing obj 
    - this formats can come from object-selections
    see <A HREF="#fmt_subObj">ObjRefs</A>



<HR><!-- ============================================================ -->
<p><a name="fmt_subObj"></a></p>
<h3>Sub-objects:</h3>

  - are parts of objects already stored in dB.
  - can come from object-selections
  - use this functionCodes:
    SEG(segment-nr)        # SEG(1) is first segment of polygon or composite-curve (CCV)
    PTS(point-code)        # PTS(1) gives startpoint, endpoint is PTS(2)
    PTI(point-index)       # PTI(2) is the second point of a polygon


Examples:
P(C21 0.25)            # parametric point on circle (parameter 0.25 = at 25 % of curve)
P(S21 0.5)             # parametric point on curve (parameter 0.5 = midpoint)
P(L20 PTS(1))          # startpoint of line 21 (endpoint is PTS(2))
P(S21 PTI(7))          # point 7 of curve-21 (a polygon)
P(S21 SEG(2) PTS(2))   # endpoint of segment 2 of compound-curve-S21
P(A20 {uPar} {vPar})   # Parametric point on a surface (not all surface-types yet supported)


L(C20 0.25)            # tangential line to circle (parameter 0.25 = at 25 % of curve)
L(C21 PTS(2))          # tangential line to circle at endpoint
L(C20 MOD(1))          # line from centerpoint of C20 to its startpoint
L(S21 0.25)            # tangential line to curve S21 at parametric pos. 0.25
L(S21 SEG(3))          # linesegment-3 of curve-21 (a polygon)
L(S22 SEG(3) SEG(1))   # linesegment-1 of curve nr 3 (a polygon) of composite-curve S22


D(C21 0.25)            # tangential vector to circle (parameter 0.25 = at 25 % of curve)
D(S21 PTS(1))          # tangential vector to startpoint of curve S21
D(S22 SEG(3))          # tangential vector to segment 3 of curve S22
D(C20 MOD(2))          # vector from centerpoint of C20 to its endpoint

C(S21 SEG(2))          # second object of composite-curve S21 (must be circle)


<HR><!-- ============================================================ -->
</PRE>
</BODY>
</HTML>
